index.html.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. <template>
  2. <!-- <div class="topBg"> -->
  3. <!-- 页面头部 -->
  4. <HomePageHead></HomePageHead>
  5. <!-- 页面导航 -->
  6. <HomePageNavigation></HomePageNavigation>
  7. <!-- </div> -->
  8. <!-- 面包屑导航 -->
  9. <div class="breadcrumb">
  10. <div class="inner">
  11. <span class="location">您的位置:</span>
  12. <el-breadcrumb :separator-icon="ArrowRight">
  13. <el-breadcrumb-item>
  14. <NuxtLink to="/">首页</NuxtLink>
  15. </el-breadcrumb-item>
  16. <el-breadcrumb-item>
  17. {{ newsDetail.con_title }}
  18. </el-breadcrumb-item>
  19. </el-breadcrumb>
  20. </div>
  21. </div>
  22. <!-- 资讯列表 -->
  23. <div class="newsDetail">
  24. <div class="inner">
  25. <div class="innerLeft">
  26. <div class="leftBottomImg" v-if="newsDetail.con_title == '会员服务'">
  27. <img src="../../../public/index/hyfw.jpg" alt="">
  28. </div>
  29. <div class="leftBottomImg" v-if="newsDetail.con_title == '联系我们'">
  30. <img src="../../../public/index/lxwm.jpg" alt="">
  31. </div>
  32. <div class="leftBottomImg" v-if="newsDetail.con_title == '法制项目简介'">
  33. <img src="../../../public/index/xmwzjj.png" alt="">
  34. </div>
  35. <div class="leftBottomImg" v-if="newsDetail.con_title == '免责声明'">
  36. <img src="../../../public/index/mzsm.png" alt="">
  37. </div>
  38. <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
  39. </div>
  40. <div class="innerRight">
  41. <ul>
  42. <li v-for="(item, index) in bottomMenu" :key="index">
  43. <NuxtLink v-if="item.type == 0" :to="`/about/${item.name_pinyin}/index.html`" :title="item.name"
  44. :class="item.id == pageId ? 'active' : ''">
  45. {{ item.name }}
  46. </NuxtLink>
  47. <NuxtLink v-else-if="item.type == 1" :to="`/about/${item.name_pinyin}/list-1.html`"
  48. :title="item.name" :class="item.id == pageId ? 'active' : ''">
  49. {{ item.name }}
  50. </NuxtLink>
  51. </li>
  52. </ul>
  53. </div>
  54. <div style="clear: both;"></div>
  55. </div>
  56. </div>
  57. <!-- 页面底部 -->
  58. <HomeFoot></HomeFoot>
  59. </template>
  60. <script setup>
  61. //1.页面依赖 start ---------------------------------------->
  62. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  63. import { ArrowRight } from '@element-plus/icons-vue'
  64. import { ref, onMounted } from 'vue';
  65. //获得跳转过来的id
  66. const route = useRoute();
  67. //获得当前的完整路径
  68. const fullPath = route.path;
  69. //拆分,取出来中间这一段,然后提取数字部分
  70. const segments = fullPath.split('/');
  71. const targetSegment = segments[2];
  72. //const numberPart = targetSegment.match(/\d+$/)?.[0];
  73. let articleId;
  74. let pageId;
  75. //通过导航路径反向查询导航id
  76. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  77. method: 'GET',
  78. query: {
  79. 'foot_pinyin': targetSegment,
  80. },
  81. });
  82. if (getRouteId.code == 200) {
  83. articleId = getRouteId.data.id;
  84. pageId = getRouteId.data.id;
  85. } else {
  86. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  87. // console.log("错误位置:通过url路径查询导航池id")
  88. // console.log("后端错误反馈:",getRouteId.message)
  89. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  90. }
  91. //1.页面依赖 end ---------------------------------------->
  92. //2.页面数据 start ---------------------------------------->
  93. //广告列表
  94. const adList = ref([]);
  95. let adImg1 = ref([]);
  96. let adImg2 = ref([]);
  97. async function getAdData() {
  98. const adData = await requestDataPromise('/web/getWebsiteAdvertisement', { method: 'GET', query: { 'ad_tag': 'PAGE' } });
  99. adList.value = adData.data;
  100. if (adData.code == 200) {
  101. for (let item of adData.data) {
  102. if (item.ad_tag == 'PAGE_0001') {
  103. adImg1.value = item;
  104. }
  105. if (item.ad_tag == 'PAGE_0002') {
  106. adImg2.value = item;
  107. }
  108. }
  109. } else {
  110. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  111. console.log("错误位置:获取详情页广告列表")
  112. console.log("后端错误反馈:", adData.message)
  113. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  114. }
  115. }
  116. getAdData();
  117. const newsDetail = ref({})
  118. const bottomMenu = ref([]);
  119. async function getPageData() {
  120. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
  121. method: 'GET',
  122. query: {
  123. 'fcat_id': articleId
  124. },
  125. });
  126. newsDetail.value = mkdata.data;
  127. }
  128. getPageData();
  129. async function getPageMenu() {
  130. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
  131. method: 'GET',
  132. query: {},
  133. });
  134. bottomMenu.value = mkdata.data;
  135. }
  136. getPageMenu();
  137. //2.页面数据 end ---------------------------------------->
  138. //4.设置seo信息 start---------------------------------------->
  139. //4.1 设置seo信息
  140. const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
  141. method: 'GET',
  142. query: {},
  143. });
  144. let seoTitle = setData.data.website_head.title;
  145. let seoDescription = setData.data.website_head.description;
  146. let seoKeywords = setData.data.website_head.keywords;
  147. let seoSuffix = setData.data.website_head.suffix;
  148. let seoName = setData.data.website_head.website_name;
  149. useSeoMeta({
  150. title: seoTitle + "_" + seoSuffix,
  151. meta: [
  152. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  153. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
  154. ]
  155. });
  156. //4.设置seo信息 end---------------------------------------->
  157. onMounted(async () => {
  158. //从客户端获取行政职能部门 加快打开速度
  159. const { $webUrl, $CwebUrl } = useNuxtApp();
  160. //广告1
  161. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0001`
  162. const responseAd1 = await fetch(url, {
  163. headers: {
  164. 'Content-Type': 'application/json',
  165. 'Userurl': $CwebUrl,
  166. 'Origin': $CwebUrl
  167. }
  168. });
  169. const resultAd1 = await responseAd1.json();
  170. adImg1.value = resultAd1.data[0];
  171. //广告2
  172. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0002`
  173. const responseAd2 = await fetch(url2, {
  174. headers: {
  175. 'Content-Type': 'application/json',
  176. 'Userurl': $CwebUrl,
  177. 'Origin': $CwebUrl
  178. }
  179. });
  180. const resultAd2 = await responseAd2.json();
  181. adImg2.value = resultAd2.data[0];
  182. })
  183. </script>
  184. <style lang="less" scoped>
  185. @media screen and (min-width: 1401px) {
  186. //导航条
  187. .breadcrumb {
  188. width: 100%;
  189. .inner {
  190. width: 1200PX;
  191. margin: 10PX auto;
  192. border-bottom: 1PX solid #E5E5E5;
  193. }
  194. .el-breadcrumb::v-deep {
  195. display: inline-block;
  196. vertical-align: -4PX;
  197. }
  198. .el-breadcrumb__inner a::v-deep,
  199. .el-breadcrumb__inner.is-link::v-deep {
  200. color: #666666;
  201. font-weight: 400;
  202. text-decoration: none;
  203. transition: var(--el-transition-color);
  204. }
  205. span {
  206. font-family: "宋体";
  207. font-weight: 400;
  208. font-size: 14PX;
  209. color: #666666;
  210. line-height: 40PX;
  211. text-align: left;
  212. font-style: normal;
  213. text-transform: none;
  214. }
  215. .location {
  216. margin-right: 10PX;
  217. display: inline-block;
  218. height: 40PX;
  219. line-height: 40PX;
  220. font-family: "宋体";
  221. font-weight: 400;
  222. font-size: 14PX;
  223. color: #666666;
  224. vertical-align: 11PX;
  225. }
  226. }
  227. // 资讯列表
  228. .newsDetail {
  229. width: 100%;
  230. margin-bottom: 70PX;
  231. .inner {
  232. width: 1200PX;
  233. font-size: 16PX;
  234. margin: 0 auto;
  235. .innerLeft {
  236. width: 980PX;
  237. float: right;
  238. .LeftTop {
  239. margin-top: 50PX;
  240. >h1 {
  241. line-height: 40PX;
  242. margin-bottom: 30PX;
  243. font-family: Microsoft YaHei, Microsoft YaHei;
  244. font-weight: bold;
  245. font-size: 30PX;
  246. color: #333333;
  247. }
  248. >p {
  249. height: 18PX;
  250. line-height: 18PX;
  251. font-family: Microsoft YaHei, Microsoft YaHei;
  252. font-weight: 400;
  253. font-size: 14PX;
  254. color: #999999;
  255. span {
  256. margin-right: 40PX;
  257. }
  258. }
  259. >img {
  260. width: 680PX;
  261. height: 382PX;
  262. padding: 50PX 0PX 60PX 55PX;
  263. }
  264. }
  265. .leftBottomImg {
  266. width: 760PX;
  267. height: 184PX;
  268. margin: 0 auto;
  269. }
  270. .leftBottom {
  271. width: 92%;
  272. font-size: 20PX;
  273. padding-top: 40PX;
  274. margin: 0 auto;
  275. font-family: "微软雅黑", Microsoft YaHei;
  276. line-height: 36PX;
  277. >h3,
  278. >p {
  279. text-indent: 2em;
  280. width: 790PX;
  281. font-family: "微软雅黑", Microsoft YaHei;
  282. font-size: 20PX;
  283. color: #333333;
  284. line-height: 23PX;
  285. padding-bottom: 30PX;
  286. }
  287. >h3 {
  288. font-weight: 600PX;
  289. }
  290. >p {
  291. font-weight: 400;
  292. }
  293. }
  294. }
  295. .innerRight {
  296. width: 200PX;
  297. margin-top: 20PX;
  298. font-family: "微软雅黑";
  299. ul {
  300. li {
  301. a {
  302. display: block;
  303. height: 50PX;
  304. line-height: 50PX;
  305. color: #000;
  306. background: #f3f3f3;
  307. font-size: 18PX;
  308. text-decoration: none;
  309. padding-left: 35PX;
  310. box-sizing: border-box;
  311. border-bottom: 1PX solid #fff;
  312. }
  313. }
  314. }
  315. .active {
  316. border-left: 0;
  317. background: #3395e4;
  318. color: #fff;
  319. }
  320. }
  321. }
  322. }
  323. }
  324. @media screen and (min-width: 801px) and (max-width: 1400px) {
  325. //导航条
  326. .breadcrumb {
  327. width: 100%;
  328. .inner {
  329. width: 90%;
  330. margin: 10PX auto;
  331. border-bottom: 1PX solid #E5E5E5;
  332. }
  333. .el-breadcrumb::v-deep {
  334. display: inline-block;
  335. vertical-align: -4PX;
  336. }
  337. .el-breadcrumb__inner a::v-deep,
  338. .el-breadcrumb__inner.is-link::v-deep {
  339. color: #666666;
  340. font-weight: 400;
  341. text-decoration: none;
  342. transition: var(--el-transition-color);
  343. }
  344. span {
  345. font-family: "宋体";
  346. font-weight: 400;
  347. font-size: 14PX;
  348. color: #666666;
  349. line-height: 40PX;
  350. text-align: left;
  351. font-style: normal;
  352. text-transform: none;
  353. }
  354. .location {
  355. margin-right: 10PX;
  356. display: inline-block;
  357. height: 40PX;
  358. line-height: 40PX;
  359. font-family: "宋体";
  360. font-weight: 400;
  361. font-size: 14PX;
  362. color: #666666;
  363. vertical-align: 11PX;
  364. }
  365. }
  366. // 资讯列表
  367. .newsDetail {
  368. width: 100%;
  369. margin-bottom: 70PX;
  370. .inner {
  371. width: 90%;
  372. margin: 0 auto;
  373. font-size: 16PX;
  374. .innerLeft {
  375. width: 75%;
  376. float: right;
  377. .LeftTop {
  378. margin-top: 50PX;
  379. >h1 {
  380. line-height: 40PX;
  381. margin-bottom: 30PX;
  382. font-family: Microsoft YaHei, Microsoft YaHei;
  383. font-weight: bold;
  384. font-size: 30PX;
  385. color: #333333;
  386. }
  387. >p {
  388. height: 18PX;
  389. line-height: 18PX;
  390. font-family: Microsoft YaHei, Microsoft YaHei;
  391. font-weight: 400;
  392. font-size: 14PX;
  393. color: #999999;
  394. span {
  395. margin-right: 40PX;
  396. }
  397. }
  398. >img {
  399. width: 680PX;
  400. height: 382PX;
  401. padding: 50PX 0PX 60PX 55PX;
  402. }
  403. }
  404. .leftBottomImg {
  405. width: 100%;
  406. img {
  407. width: 100%;
  408. }
  409. }
  410. .leftBottom {
  411. width: 92%;
  412. font-size: 20PX;
  413. padding-top: 40PX;
  414. margin: 0 auto;
  415. font-family: "微软雅黑", Microsoft YaHei;
  416. line-height: 36PX;
  417. >h3,
  418. >p {
  419. text-indent: 2em;
  420. width: 100%;
  421. font-family: "微软雅黑", Microsoft YaHei;
  422. font-size: 20PX;
  423. color: #333333;
  424. line-height: 23PX;
  425. padding-bottom: 30PX;
  426. }
  427. >h3 {
  428. font-weight: 600;
  429. }
  430. >p {
  431. font-weight: 400;
  432. }
  433. }
  434. }
  435. .innerRight {
  436. width: 20%;
  437. margin-top: 20PX;
  438. margin-right: 20PX;
  439. font-family: "微软雅黑";
  440. ul {
  441. li {
  442. a {
  443. display: block;
  444. height: 50PX;
  445. line-height: 50PX;
  446. color: #000;
  447. background: #f3f3f3;
  448. font-size: 18PX;
  449. text-decoration: none;
  450. padding-left: 35PX;
  451. box-sizing: border-box;
  452. border-bottom: 1PX solid #fff;
  453. }
  454. }
  455. }
  456. .active {
  457. border-left: 0;
  458. background: #3395e4;
  459. color: #fff;
  460. }
  461. }
  462. }
  463. }
  464. }
  465. @media screen and (max-width: 800px) {
  466. //导航条
  467. .breadcrumb {
  468. width: 100%;
  469. .inner {
  470. width: 100%;
  471. padding: 0 20px;
  472. border-bottom: 2px solid #E5E5E5;
  473. }
  474. .el-breadcrumb::v-deep {
  475. display: inline-block;
  476. vertical-align: -4px;
  477. }
  478. .el-breadcrumb__inner a::v-deep,
  479. .el-breadcrumb__inner.is-link::v-deep {
  480. color: #666666;
  481. font-weight: 400;
  482. text-decoration: none;
  483. transition: var(--el-transition-color);
  484. }
  485. span {
  486. font-family: "宋体";
  487. font-weight: 400;
  488. font-size: 28px;
  489. color: #666666;
  490. line-height: 80px;
  491. text-align: left;
  492. font-style: normal;
  493. text-transform: none;
  494. }
  495. .location {
  496. margin-right: 10px;
  497. display: inline-block;
  498. height: 80px;
  499. line-height: 80px;
  500. font-family: "宋体";
  501. font-weight: 400;
  502. font-size: 28px;
  503. color: #666666;
  504. vertical-align: 24px;
  505. }
  506. }
  507. // 资讯列表
  508. .newsDetail {
  509. width: 100%;
  510. margin-bottom: 70px;
  511. .inner {
  512. width: 100%;
  513. font-size: 32px;
  514. .innerLeft {
  515. width: 100%;
  516. margin-top: 20px;
  517. .leftBottomImg {
  518. width: 100%;
  519. text-align: center;
  520. img {
  521. width: 96%;
  522. }
  523. }
  524. .leftBottom {
  525. width: 92%;
  526. font-size: 40px !important;
  527. padding-top: 40px;
  528. margin: 0 auto;
  529. font-family: "微软雅黑", Microsoft YaHei;
  530. line-height: 72px;
  531. h3,
  532. p {
  533. width: 100%;
  534. font-family: "微软雅黑", Microsoft YaHei;
  535. font-size: 40px;
  536. color: #333333;
  537. line-height: 72px;
  538. padding-bottom: 30px;
  539. }
  540. h3 {
  541. font-weight: 600;
  542. }
  543. p {
  544. font-weight: 400;
  545. }
  546. span {
  547. font-size: 40px !important;
  548. }
  549. }
  550. }
  551. .innerRight {
  552. display: none;
  553. width: 200px;
  554. margin-top: 20px;
  555. font-family: "微软雅黑";
  556. ul {
  557. li {
  558. a {
  559. display: block;
  560. height: 50px;
  561. line-height: 50px;
  562. color: #000;
  563. background: #f3f3f3;
  564. font-size: 18px;
  565. text-decoration: none;
  566. padding-left: 35px;
  567. box-sizing: border-box;
  568. border-bottom: 1px solid #fff;
  569. }
  570. }
  571. }
  572. .active {
  573. border-left: 0;
  574. background: #3395e4;
  575. color: #fff;
  576. }
  577. }
  578. }
  579. }
  580. }
  581. </style>